# ---------------------------------------------------------------------------- #
# TEST_API_LOGIN
# ---------------------------------------------------------------------------- #
add_executable(
    test_api_login
    ${CMAKE_CURRENT_SOURCE_DIR}/test_api_login.cpp
    ${COMMON_SOURCES}
)
target_include_directories(test_api_login PUBLIC ${CMAKE_SOURCE_DIR}/src)
target_link_libraries(test_api_login
    ${Boost_LIBRARIES}
    ${Crow_LIBRARIES}
    ${OpenSSL_LIBRARIES}
    ${cpr_LIBRARIES}
    ${nlohmann_json_LIBRARIES}
    ${ICU_LIBRARIES}
)
add_test(
    NAME test_api_login
    COMMAND test_api_login
)

# ---------------------------------------------------------------------------- #
# TEST_API_LOGOUT
# ---------------------------------------------------------------------------- #
add_executable(
    test_api_logout
    ${CMAKE_CURRENT_SOURCE_DIR}/test_api_logout.cpp
    ${COMMON_SOURCES}
)
target_include_directories(test_api_logout PUBLIC ${CMAKE_SOURCE_DIR}/src)
target_link_libraries(test_api_logout
    ${Boost_LIBRARIES}
    ${Crow_LIBRARIES}
    ${OpenSSL_LIBRARIES}
    ${cpr_LIBRARIES}
    ${nlohmann_json_LIBRARIES}
    ${ICU_LIBRARIES}
)
add_test(
    NAME test_api_logout
    COMMAND test_api_logout
)

# ---------------------------------------------------------------------------- #
# TEST_API_HAS_CHANGES
# ---------------------------------------------------------------------------- #
add_executable(
    test_api_has_changes
    ${CMAKE_CURRENT_SOURCE_DIR}/test_api_has_changes.cpp
    ${COMMON_SOURCES}
)
target_include_directories(test_api_has_changes PUBLIC ${CMAKE_SOURCE_DIR}/src)
target_link_libraries(test_api_has_changes
    ${Boost_LIBRARIES}
    ${Crow_LIBRARIES}
    ${OpenSSL_LIBRARIES}
    ${cpr_LIBRARIES}
    ${nlohmann_json_LIBRARIES}
    ${ICU_LIBRARIES}
)
add_test(
    NAME test_api_has_changes
    COMMAND test_api_has_changes
)

# ---------------------------------------------------------------------------- #
# TEST_API_DEL_ELEMENT
# ---------------------------------------------------------------------------- #
add_executable(
    test_api_del_element
    ${CMAKE_CURRENT_SOURCE_DIR}/test_api_del_element.cpp
    ${COMMON_SOURCES}
)
target_include_directories(test_api_del_element PUBLIC ${CMAKE_SOURCE_DIR}/src)
target_link_libraries(test_api_del_element
    ${Boost_LIBRARIES}
    ${Crow_LIBRARIES}
    ${OpenSSL_LIBRARIES}
    ${cpr_LIBRARIES}
    ${nlohmann_json_LIBRARIES}
    ${ICU_LIBRARIES}
)
add_test(
    NAME test_api_del_element
    COMMAND test_api_del_element
)

# ---------------------------------------------------------------------------- #
# TEST_API_SET_ELEMENT
# ---------------------------------------------------------------------------- #
add_executable(
    test_api_set_element
    ${CMAKE_CURRENT_SOURCE_DIR}/test_api_set_element.cpp
    ${COMMON_SOURCES}
)
target_include_directories(test_api_set_element PUBLIC ${CMAKE_SOURCE_DIR}/src)
target_link_libraries(test_api_set_element
    ${Boost_LIBRARIES}
    ${Crow_LIBRARIES}
    ${OpenSSL_LIBRARIES}
    ${cpr_LIBRARIES}
    ${nlohmann_json_LIBRARIES}
    ${ICU_LIBRARIES}
)
add_test(
    NAME test_api_set_element
    COMMAND test_api_set_element
)

# ---------------------------------------------------------------------------- #
# TEST_API_ADD_ELEMENT
# ---------------------------------------------------------------------------- #
add_executable(
    test_api_add_element
    ${CMAKE_CURRENT_SOURCE_DIR}/test_api_add_element.cpp
    ${COMMON_SOURCES}
)
target_include_directories(test_api_add_element PUBLIC ${CMAKE_SOURCE_DIR}/src)
target_link_libraries(test_api_add_element
    ${Boost_LIBRARIES}
    ${Crow_LIBRARIES}
    ${OpenSSL_LIBRARIES}
    ${cpr_LIBRARIES}
    ${nlohmann_json_LIBRARIES}
    ${ICU_LIBRARIES}
)
add_test(
    NAME test_api_add_element
    COMMAND test_api_add_element
)

# ---------------------------------------------------------------------------- #
# TEST_API_GET_ELEMENTS
# ---------------------------------------------------------------------------- #
add_executable(
    test_api_get_elements
    ${CMAKE_CURRENT_SOURCE_DIR}/test_api_get_elements.cpp
    ${COMMON_SOURCES}
)
target_include_directories(test_api_get_elements PUBLIC ${CMAKE_SOURCE_DIR}/src)
target_link_libraries(test_api_get_elements
    ${Boost_LIBRARIES}
    ${Crow_LIBRARIES}
    ${OpenSSL_LIBRARIES}
    ${cpr_LIBRARIES}
    ${nlohmann_json_LIBRARIES}
    ${ICU_LIBRARIES}
)
add_test(
    NAME test_api_get_elements
    COMMAND test_api_get_elements
)
